<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="header.jsp"%>
<script>
	window.addEventListener("load", function() {
		var checkId = document.querySelector("#idcheck");
		checkId.addEventListener("click", function() {
			var id = document.querySelector("#id");
			var url = "hire?id=" + id.value;
			var xhr = new XMLHttpRequest();
			xhr.addEventListener("load", function(e) {
				document.querySelector("#idcheckresult").innerHTML
				= e.target.responseText;
			});
			xhr.open("get", url, true);
			xhr.send()
		});

			
	});
</script>
<div class="clear"></div>
<div id="main">
	<section>
		<form method="post" action="hire">
			<fieldset>
				<legend>직원 정보</legend>
				<label for="id">아이디</label> 
				<input type="text" name="id" id="id"
					required> 
					<input type="button" id="idcheck" value="아이디확인">
					<div id="idcheckresult"></div>
				<br> 
				<label for="name">직원명</label> 
				<input type="text"
					name="name" id="name" required><br> 
				<label for="pass">비밀번호</label>
				<input type="password" name="pass" id="pass" required>

				<input type="submit">
			</fieldset>
		</form>
	</section>
</div>
<div class="clear"></div>
<%@ include file="footer.jsp"%>